package com.ebeitech.auction.http.model;

import com.ebeitech.auction.bean.AuctionBid;
import com.ebeitech.auction.bean.AuctionPhase;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * Created by alice on 2017/11/14.
 */
public class AuctionPhaseModel {

	private List<AuctionPhase> auctionPhases;
	private List<AuctionBid> bids;

	public List<AuctionPhase> getAuctionPhases() {
		if (auctionPhases == null) {
			auctionPhases = new ArrayList<AuctionPhase>();
		}
		Collections.sort(auctionPhases, new Comparator<AuctionPhase>() {
			@Override
			public int compare(AuctionPhase lhs, AuctionPhase rhs) {
				return lhs.getPhaseSort() - rhs.getPhaseSort();
			}
		});
		return auctionPhases;
	}

	public void setAuctionPhases(List<AuctionPhase> auctionPhases) {
		this.auctionPhases = auctionPhases;
	}

	public List<AuctionBid> getBids() {
		return bids;
	}

	public void setBids(List<AuctionBid> bids) {
		this.bids = bids;
	}
}
